package com.henghe.frame.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.henghe.frame.auth.entity.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2024/6/12 15:06
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("select distinct b.* from sys_role_user a inner join sys_role b on a.role_id = b.id where a.user_id = #{userId}")
    List<SysRole> getRoleByUserId(@Param("userId") Long userId);
}
